package org.zjx.analysis.analyze.manager;


import org.zjx.analysis.analyze.DefaultAnalysisManager;
import org.zjx.analysis.analyze.login.*;

public class LoginAnalysisManager extends DefaultAnalysisManager {

    // 使用 volatile 关键字确保多线程环境下的可见性和有序性
    private static volatile LoginAnalysisManager instance;

    // 私有构造方法，防止外部实例化
    private LoginAnalysisManager() {
        registerAnalyzer(new LoginHomeAnalysis());
        registerAnalyzer(new LoginToggleAnalysis());
        registerAnalyzer(new LoginAccountAnalysis());
        registerAnalyzer(new LoginServerAnalysis());
        registerAnalyzer(new LoginRoleAnalysis());
        registerAnalyzer(new LoginCreateAnalysis());
        registerAnalyzer(new LoginChooseTypeAnalysis());
    }

    // 全局访问点
    public static LoginAnalysisManager getInstance() {
        if (instance == null) {
            synchronized (LoginAnalysisManager.class) {
                if (instance == null) {
                    instance = new LoginAnalysisManager();
                }
            }
        }
        return instance;
    }
}